import java.util.*;

//public void heapSort(){
//    int end = this.usedSize-1;
//    while (end > 0){
//        int tmp = elem[0];
//        elem[0] = elem[end];
//        elem[end] = tmp;
//        shiftDown(0,end);
//        end--;
//
//    }
//
// }




class Solution {
    public int findRepeatNumber(int[] nums){
        //Set<Integer> dic = new HashSet<>();
        /*for (int i = 0; i < nums.length; i++) {
            if (dic.contains(nums[i])){
                return nums[i];
            }else {
                dic.add(nums[i]);
            }
        }*/
        /*for (int num: nums) {
            if (dic.contains(num)){
                return num;
            }else {
                dic.add(num);
            }

        }*/

        int i = 0;
        while (i < nums.length){
            if (nums[i] == i){
                i++;
                continue;
            }
            if (nums[nums[i]] == nums[i]){
                return nums[i];
            }
            int tmp = nums[i];
            nums[i] = nums[tmp];
            nums[tmp] = tmp;
        }
        return  -1;
    }
}
//class Solution {
//    public List<List<Integer>> kSmallestPairs(int[] nums1, int[] nums2, int k){
//        PriorityQueue<List<Integer>> maxHeap = new PriorityQueue<>(k, new Comparator<List<Integer>>() {
//            @Override
//            public int compare(List<Integer> o1, List<Integer> o2) {
//                return (o2.get(0)+o2.get(1))-(o1.get(0)+o1.get(1));
//            }
//        });
//        for (int i = 0; i < nums1.length ; i++) {
//
//
//        }
//    }
//}
class Card {
    public int rank;
    public String suit;
    private Card o;

    public Card(int rank, String suit) {
        this.rank = rank;
        this.suit = suit;
    }

//class RankComparator implements Comparator<Card>{
//
//        @Override
//        public int compare(Card o1, Card o2) {
//            return o1.rank-o2.rank;
//        }
//    }

    @Override
    public String toString() {
        return "Card{" +
                "rank=" + rank +
                ", suit='" + suit + '\'' +
                '}';
    }
}
public class u {
    public static void main(String[] args) {
        Card card = new Card(1,"H");
        Card card1 = new Card(1,"H");
//        PriorityQueue<Card> priorityQueue = new PriorityQueue<>();
//        priorityQueue.offer(new Card(2,"H"));
//        priorityQueue.offer(new Card(1,"H"));
//        System.out.println(priorityQueue);
//        System.out.println(card.compareTo(card1));
        PriorityQueue<Card> priorityQueue = new PriorityQueue<>(new Comparator<Card>() {
            @Override
            public int compare(Card o1, Card o2) {
                return o1.rank-o2.rank;
            }
        });
        RankComparator rank = new RankComparator();
        int ret = rank.compare(card,card1);
        System.out.println(ret);
    }

}
